//
//  BaseTableViewController.swift
//  SinaWeibo
//
//  Created by apple on 15/11/12.
//  Copyright © 2015年 apple. All rights reserved.
//

import UIKit

class BaseTableViewController: UITableViewController,VistorLoginViewdelegate {
    
    var userLogin = false
    
    var visitorLoginView : VistorLoginView?
    
    override func loadView() {
        userLogin ? super.loadView() : loadVistorView()
    }
    private func loadVistorView(){
        
        //        let v = UIView()
        //        v.backgroundColor = UIColor.redColor()
        //        view = v
        //
        //       print(view)
//        view = VistorLoginView()
        visitorLoginView = VistorLoginView()
        
       visitorLoginView?.vistordelegate = self
                view = visitorLoginView
        self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "注册", style: .Plain, target: self, action: "vistorWillRegister")
         self.navigationItem.leftBarButtonItem = UIBarButtonItem(title: "登陆", style: .Plain, target: self, action: "vistorWillLogin")
        
    }
    /**
     代理方法 
     */
    func vistorWillRegister(){
    print("come on")
    
    }
    func vistorWillLogin(){
        print("come in")

    }
    override func viewDidLoad() {
        super.viewDidLoad()
        
    }
    
    
}
